<template>
    <div class="supermarket">
        <div class="header">
            <div class="header-left">
                <span @click="goback()"></span>
            </div>
            <div class="header-center">
                京东超市
            </div>
            <div class="header-right" @click="change()">
                <span></span>
            </div>
            <div class="drop-down-list" v-show="show1">
                <ul>
                    <li>
                        <router-link to="/">
                            <span><img src="../../assets/images/dropdownlist1.png" alt=""></span>
                            <strong>首页</strong>
                        </router-link>
                    </li>
                    <li>
                        <router-link to="/classification">
                            <span><img src="../../assets/images/dropdownlist2.png" alt=""></span>
                            <strong>分类搜索</strong>
                        </router-link>
                    </li>
                    <li>
                        <router-link to="/">
                            <span><img src="../../assets/images/dropdownlist3.png" alt=""></span>
                            <strong>购物车</strong>
                        </router-link>
                    </li>
                    <li>
                        <router-link to="/">
                        <span><img src="../../assets/images/dropdownlist4.png" alt=""></span>
                            <strong>我的京东</strong>
                        </router-link>
                    </li>
                    <li>
                        <router-link to="/">
                        <span><img src="../../assets/images/dropdownlist5.png" alt=""></span>
                            <strong>浏览记录</strong>
                        </router-link>
                    </li>
                </ul>
            </div>
        </div>

        <div class="main1">
            <mt-swipe :auto="4000" class="swipe">
                <mt-swipe-item><img src="../../assets/images/jdshop001.webp.jpg" alt=""></mt-swipe-item>
                <mt-swipe-item><img src="../../assets/images/jdshop002.webp.jpg" alt=""></mt-swipe-item>
                <mt-swipe-item><img src="../../assets/images/jdshop003.webp.jpg" alt=""></mt-swipe-item>
                <mt-swipe-item><img src="../../assets/images/jdshop004.webp.jpg" alt=""></mt-swipe-item>
                <mt-swipe-item><img src="../../assets/images/jdshop005.webp.jpg" alt=""></mt-swipe-item>
                <mt-swipe-item><img src="../../assets/images/jdshop006.webp.jpg" alt=""></mt-swipe-item>
                <mt-swipe-item><img src="../../assets/images/jdshop007.webp.jpg" alt=""></mt-swipe-item>
                <mt-swipe-item><img src="../../assets/images/jdshop008.webp.jpg" alt=""></mt-swipe-item>
            </mt-swipe>

            <div class="navigation-search">
                <div class="search-bar">
                    <img src="../../assets/images/jdshop_search.png" alt="">
                    <input type="text" placeholder="一站式囤生活好物">
                </div>
            </div>
        </div>

        <div class="esure">
            <img src="../../assets/images/jdshop_nav.jpg" alt="">
        </div>

        <div class="jdpic">
            <img src="../../assets/images/jdshop_111.gif" alt="">
        </div>

        <div class="slide">

        </div>

        <div class="vouchers">
            <div class="voucher">
                <div class="v-main">
                    <div class="thefirst">
                        <div class="fonts">
                            <p class="font-top">
                                <span class="thebig">8<span class="thesmall">.8</span></span>
                                <span class="unit">折</span>
                                <span class="det">满118可用</span>
                            </p>
                            <p class="font-center">
                                仅可购买家清部分商品
                            </p>
                            <p class="thedata">
                                2020.07.15-2020.07.21使用
                            </p>
                        </div>
                    </div>
                    <div class="thesecond">     
                    </div>
                    <div class="thethird">
                        <div class="getvoucher">
                            立即领券
                        </div>
                    </div>
                </div>
            </div>
            <div class="voucher">
                <div class="v-main">
                    <div class="thefirst">
                        <div class="fonts">
                            <p class="font-top">
                                <span class="thesmall">￥<span class="thebig">120</span></span>
                                <!-- <span class="unit">折</span> -->
                                <span class="det">满199可用</span>
                            </p>
                            <p class="font-center">
                                限购  [三只松鼠旗舰店] 店铺部分商品
                            </p>
                            <p class="thedata">
                                2020.07.15-2020.07.28使用
                            </p>
                        </div>
                    </div>
                    <div class="thesecond">     
                    </div>
                    <div class="thethird">
                        <div class="getvoucher">
                            立即领券
                        </div>
                    </div>
                </div>
            </div>
            <div class="voucher">
                <div class="v-main">
                    <div class="thefirst">
                        <div class="fonts">
                            <p class="font-top">
                                <span class="thebig">8<span class="thesmall">.8</span></span>
                                <span class="unit">折</span>
                                <span class="det">满118可用</span>
                            </p>
                            <p class="font-center">
                                仅可购买家清部分商品
                            </p>
                            <p class="thedata">
                                2020.07.15-2020.07.21使用
                            </p>
                        </div>
                    </div>
                    <div class="thesecond">     
                    </div>
                    <div class="thethird">
                        <div class="getvoucher">
                            立即领券
                        </div>
                    </div>
                </div>
            </div>
            <div class="voucher">
                <div class="v-main">
                    <div class="thefirst">
                        <div class="fonts">
                            <p class="font-top">
                                <span class="thebig">8<span class="thesmall">.8</span></span>
                                <span class="unit">折</span>
                                <span class="det">满118可用</span>
                            </p>
                            <p class="font-center">
                                仅可购买家清部分商品
                            </p>
                            
                        </div>
                    </div>
                    <div class="thesecond">     
                    </div>
                    <div class="thethird">
                        <div class="getvoucher">
                            立即领券
                        </div>
                    </div>
                </div>
            </div>
            <div class="voucher">
                <div class="v-main">
                    <div class="thefirst">
                        <div class="fonts">
                            <p class="font-top">
                                <span class="thebig">8<span class="thesmall">.8</span></span>
                                <span class="unit">折</span>
                                <span class="det">满118可用</span>
                            </p>
                            <p class="font-center">
                                仅可购买家清部分商品
                            </p>
                            
                        </div>
                    </div>
                    <div class="thesecond">     
                    </div>
                    <div class="thethird">
                        <div class="getvoucher">
                            立即领券
                        </div>
                    </div>
                </div>
            </div>
            <div class="voucher">
                <div class="v-main">
                    <div class="thefirst">
                        <div class="fonts">
                            <p class="font-top">
                                <span class="thebig">8<span class="thesmall">.8</span></span>
                                <span class="unit">折</span>
                                <span class="det">满118可用</span>
                            </p>
                            <p class="font-center">
                                仅可购买家清部分商品
                            </p>
                            
                        </div>
                    </div>
                    <div class="thesecond">     
                    </div>
                    <div class="thethird">
                        <div class="getvoucher">
                            立即领券
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- <div class="snap-up">
            <div class="snap-up-title">
                <img src="../../assets/images/qianggou.webp.jpg" alt="">
            </div>
            <div class="snap-up-time">
                <mt-navbar v-model="selected">
                    <mt-tab-item id="1">16:00</mt-tab-item>
                    <mt-tab-item id="2">20:00</mt-tab-item>
                    <mt-tab-item id="3">00:00</mt-tab-item>
                    <mt-tab-item id="4">08:00</mt-tab-item>
                </mt-navbar>

                
                
                <mt-tab-container v-model="selected">
                    <mt-tab-container-item id="1">
                        <ul class="snapup">
                            <li v-for="(v,i) in snapup" :key="i">
                                <router-link to="/">
                                    <img :src="v.imgs" />
                                    <p class="price">{{v.title}}</p>
                                    <p class="originalprice">{{v.originalprice}}</p>
                                    <p class="originalprice">{{v.price}}</p>
                                </router-link>
                            </li>
                            <li></li>
                            <li></li>
                            <li></li>
                        </ul>
                    </mt-tab-container-item>
                    <mt-tab-container-item id="2">
                        <h1>内容2</h1>
                    </mt-tab-container-item>
                    <mt-tab-container-item id="3">
                        <h1>内容3</h1>
                    </mt-tab-container-item>
                    <mt-tab-container-item id="4">
                        <h1>内容4</h1>
                    </mt-tab-container-item>
                </mt-tab-container>
            </div>
        </div> -->

        <div class="jdshop_bottom">
            <img src="../../assets/images/jdshop-bottom.gif" alt="">
        </div>
    </div>
</template>
<script>

export default{
    data(){
        return{
            show1:false,
            selected:'1',
            snapup:[]
        }
    },
    mounted(){
         
        this.$http.get('./data/jdshop.json')
        .then((respone)=>{
            // console.log(respone.data);
           
            this.snapup=respone.data.snapup;

            console.log(this.snapup);
            for(var i in this.snapup){
                console.log(this.snapup[i].imgs)
            }
            
        })
        .catch(function (error) {
            // handle error
            console.log(error);
        })
        .then(function () {
            // always executed
        });
    },
    methods:{
        change(){
            this.show1=!this.show1
        },
        goback(){
            this.$router.go(-1)
        }
    }
}
</script>
<style scoped>
    .supermarket{
        background: #f0f0f0;
    }
    .supermarket .header{
        position: relative;
        height: 44px;
        width: 100%;
        border-bottom: 1px solid #e5e5e5;
        background-color: #fff;
        /* margin-top: -60px; */
    }
    .supermarket .header-left{
        width: 10%;
        height: 44px;
        padding-top: 1px;
        float: left;
    }
    .supermarket .header-left span{
        background: url("") no-repeat 50%;
        margin: 12px 0 0 10px;
        width: 20px;
        height: 20px;
        background-position: 0 0;
        background-size: contain;
        display: block;
    }
    .supermarket .header-center{
        float: left;
        text-align: center;
        width: 80%;
        line-height: 44px;
    }
    .supermarket .header-right{
        float: left;
        width: 10%;
    }
    .supermarket .header-right span{
        background: url() no-repeat 50%;
        margin: 12px 12px 12px 0px;
        width: 20px;
        height: 20px;
        background-size: 20px;
        display: block;
    }
    .supermarket .drop-down-list ul{
        position: absolute;
        border-radius: 4px;
        width: 125px;
        background: rgba(0,0,0,.9);
        top: 53px;
        right: 10px;
        z-index: 1000;
    }
    .supermarket .drop-down-list ul::before{
        position: absolute;
        top: -5px;
        right: 5px;
        width: 10.5px;
        height: 5px;
        background: url() no-repeat 50%;
        background-size: 100% 100%;
        content: "";
    }
    .supermarket .drop-down-list ul li{
        display: block;
        position: relative;
        margin-left: 40px;
        border-bottom: 1px solid hsla(0,0%,100%,.2);
        height: 40px;
        line-height: 40px;
        z-index: 1000;
        font-size: 14px;
    }
    .supermarket .drop-down-list ul li a{
        color: #fff;
        text-decoration: none;
        font-size: 14px;   
    }
    .supermarket .drop-down-list ul li span{
        position: absolute;
        top: 0;
        left: -40px;
        width: 40px;
        height: 40px;
    }
    .supermarket .drop-down-list ul li span img{
        width: 15px;
        height: 15px;;
    }
    .supermarket .swipe{
        height: 200px;
        position: relative;
        overflow: hidden;
        list-style: none;
        padding: 0;
        z-index: 1;
    }
    .supermarket .swipe{
        position: relative;
        width: 100%;
        background-color: #f8f8f8;
        top: 90%;
    }
    .supermarket .mint-swipe-item{
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
        /* background-color: #f8f8f8; */
    }
    .supermarket .swipe img{
        position: absolute;
        width: 100%;
        left: 0;
        top: -5.4rem;
        /* background-color: #f8f8f8; */
    }
    .supermarket .mint-swipe-item{
        position: absolute;
    }
    .supermarket .main1{
        position: relative;
    }
    .supermarket .navigation-search{
        width: 100%;
        position: absolute;
        top: 0px;
        left: 0px;
        z-index: 2;
    }
    .supermarket .navigation-search .search-bar{
        padding: 0px 20px;
        height: 30px;
        background-color: #fff;
        border-radius: 50px;
        width: 80%;
        margin: 5px auto 0px;
    }
    .supermarket .navigation-search .search-bar img{
        position: absolute;
        top: 13px;
        left: 30px;
        width: 15px;
    }
    .supermarket .navigation-search .search-bar input{
        width: 90%;
        margin-top: 7px;
        border: none;
        outline: none;
        font-size: 14px;
    }
    .supermarket .esure img{
        display: block;
        position: relative;
        z-index: 9;
        top: -9px;
        left: 0px;
        width: 100%;
    }
    .supermarket .jdpic{
        margin-top: -9px;
    }
    .supermarket .jdpic img{
        width: 100%;
    }
    .supermarket .slide{
        width: 100%;
        height: 200px;
        background-color: pink;
    }
    .supermarket .vouchers{
        overflow: hidden;
        /* width: 100%; */
        height: 120px;
        margin-top: 10px;
        position: relative;
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        padding-left: 20px;
        padding-right: 10px;
        background-color: #fff;
        margin-bottom: 10px;
    }
    .supermarket .vouchers .voucher{
        width: 33%;
        height: 50%;
        /* margin: 0 auto; */
        /* margin-bottom: 5px; */
        margin-top: 5px;
        /* margin-left: .4rem; */
    }
    .supermarket .vouchers .voucher .v-main{
        width: 100%;
        /* margin-right: 5px; */
        text-align: center;
        display: inline-block;
        height: 100%;
        position: relative;
    }
    .supermarket .vouchers .thefirst{
        float: left;
        background: url("");
        width: 86%;
        height: 100%;
        background-repeat: no-repeat;
        background-size: 100% 100%;
    }
    .supermarket .vouchers .thesecond{
        background: url("");
        float: left;
        width: 9%;
        height: 96%;
        background-size: 1.33333rem 4.6rem;
        background-repeat: no-repeat;
    }
    .supermarket .vouchers .thethird{
        background: url("");
        float: left;
        width: 3%;
        height: 100%;
        background-size: 0.33333rem 3.6rem;
        background-repeat: no-repeat;
    }
    .supermarket .vouchers .fonts{
        display: block;
        width: 100%;
        height: 100%;
        padding-top: 1px;
    }
    .supermarket .fonts .font-top{
        width: 100%;
        height: 47%;
        white-space: nowrap;
        overflow: hidden;
        color: #fff;
        padding-top: .26667rem;
    }
    .supermarket .font-top .thebig{
        font-size: 1.3rem;
    }
    .supermarket .font-top .thesmall{
        font-size: 0.8rem;
        height: 1.51rem;
        line-height: 1.56rem;
        vertical-align: baseline;
    }
    .supermarket .unit{
        display: inline-block;
        font-family: JDZhengHT-Regular;
        vertical-align: text-top; 
        font-size: 0.8rem;
        height: .50667rem;   
    }
    .supermarket .det{
        margin-left: .001rem;
        margin-top: .06667rem;
        max-width: 1.46667rem;
        font-size: 0.4rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .supermarket .font-center{
        max-width: 100%;
        margin-top: 0px;
        margin-left: 0.2rem;
        margin-right: 0.2rem;
        padding-left: 0.1rem;
        padding-right: 0.1rem;
        height: 0.6rem;
        background-color: #fff;
        border-radius: 1rem;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: rgb(239, 74, 43);
        font-size: 0.1rem;
    }
    .supermarket .thedata{
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.1rem;
        margin-top: 0.2rem;
        color: #fff;
    }
    .supermarket .getvoucher{
        width: 0.8rem;
        /* background-color: #fff; */
        background-color: rgb(228, 61, 60);
        display: flex;
        position: absolute;
        left: 91px;
        right: 0;
        bottom: 0;
        top: -20px;
        margin: auto;
        height: 1.6rem;
        font-weight: 700;
        font-family: PingFangSC-Semibold;
        font-size: 0.4rem;
        line-height: 0.7rem;
        color: #fff;
    }
    .supermarket .snap-up{
        background-color: #fff;
    }
    .supermarket .snap-up .snap-up-title{
        width: 100%;
        height: 1.8rem;
        overflow: hidden;
    }
    .supermarket .snap-up .snap-up-title img{
        width: 100%;
    }
    .supermarket .snap-up .snap-up-time{
        padding: 5px 10px;
    }
    .supermarket .snap-up-time .mint-navbar a{
        float: left;
        margin-left: .116rem;
        width: 2.21333rem;
        height: .61333rem;
        line-height: .61333rem;
        background-size: 2.21333rem .61333rem;
        border-radius: 3.30667rem;
        font-size: .4rem;
        color: #505050;
        text-align: center;
        background-color: #f6f6f6;
        margin-top: .17333rem;
        border-bottom: none;
    }
    .supermarket .snap-up-time .mint-navbar .mint-tab-item{
        padding: 5px 0px;
    }
    .supermarket .snap-up-time ul{
        padding-left: .24rem;
        white-space: nowrap;
        /* height: 5.30667rem; */
        overflow-x: auto;
        overflow-y: hidden;
    }
    .supermarket .snap-up-time ul img{
        width: 100px;
        float: left;
    }
    .supermarket .snap-up-time ul p{
        float: left;
    }
    .supermarket .snap-up-time ul li{
        width: 100px;
    }
    .jdshop_bottom img{
        width: 100%;
    }
</style>